<div class="territories view">
<h2><?php  __('Territory');?></h2>
	<dl><?php $i = 0; $class = ' class="altrow"';?>
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Territory Id'); ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>
			<?php echo $territory['Territory']['territory_id']; ?>
			&nbsp;
		</dd>
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Territory Name'); ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>
			<?php echo $territory['Territory']['territory_name']; ?>
			&nbsp;
		</dd>
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Territory Type'); ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>
			<?php echo $territory['Territory']['territory_type']; ?>
			&nbsp;
		</dd>
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Parent Territory'); ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>
			<?php echo $this->Html->link($territory['ParentTerritory']['territory_name'], array('controller' => 'territories', 'action' => 'view', $territory['ParentTerritory']['territory_id'])); ?>
			&nbsp;
		</dd>
	</dl>
</div>
<div class="actions">
	<h3><?php __('Actions'); ?></h3>
	<ul>
		<li><?php echo $this->Html->link(__('Edit Territory', true), array('action' => 'edit', $territory['Territory']['territory_id'])); ?> </li>
		<li><?php echo $this->Html->link(__('Delete Territory', true), array('action' => 'delete', $territory['Territory']['territory_id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $territory['Territory']['territory_id'])); ?> </li>
		<li><?php echo $this->Html->link(__('List Territories', true), array('action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New Territory', true), array('action' => 'add')); ?> </li>
		<li><?php echo $this->Html->link(__('List Territories', true), array('controller' => 'territories', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New Parent Territory', true), array('controller' => 'territories', 'action' => 'add')); ?> </li>
		<li><?php echo $this->Html->link(__('List Lookup Values', true), array('controller' => 'lookup_values', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New Territory Type', true), array('controller' => 'lookup_values', 'action' => 'add')); ?> </li>
		<li><?php echo $this->Html->link(__('List Addresses', true), array('controller' => 'addresses', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New Province Address', true), array('controller' => 'addresses', 'action' => 'add')); ?> </li>
	</ul>
</div>
<div class="related">
	<h3><?php __('Related Territories');?></h3>
	<?php if (!empty($territory['DependentTerritory'])):?>
	<table cellpadding = "0" cellspacing = "0">
	<tr>
		<th><?php __('Territory Id'); ?></th>
		<th><?php __('Territory Name'); ?></th>
		<th><?php __('Territory Type'); ?></th>
		<th><?php __('Parent Territory Id'); ?></th>
		<th class="actions"><?php __('Actions');?></th>
	</tr>
	<?php
		$i = 0;
		foreach ($territory['DependentTerritory'] as $dependentTerritory):
			$class = null;
			if ($i++ % 2 == 0) {
				$class = ' class="altrow"';
			}
		?>
		<tr<?php echo $class;?>>
			<td><?php echo $dependentTerritory['territory_id'];?></td>
			<td><?php echo $dependentTerritory['territory_name'];?></td>
			<td><?php echo $dependentTerritory['territory_type'];?></td>
			<td><?php echo $dependentTerritory['parent_territory_id'];?></td>
			<td class="actions">
				<?php echo $this->Html->link(__('View', true), array('controller' => 'territories', 'action' => 'view', $dependentTerritory['territory_id'])); ?>
				<?php echo $this->Html->link(__('Edit', true), array('controller' => 'territories', 'action' => 'edit', $dependentTerritory['territory_id'])); ?>
				<?php echo $this->Html->link(__('Delete', true), array('controller' => 'territories', 'action' => 'delete', $dependentTerritory['territory_id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $dependentTerritory['territory_id'])); ?>
			</td>
		</tr>
	<?php endforeach; ?>
	</table>
<?php endif; ?>

	<div class="actions">
		<ul>
			<li><?php echo $this->Html->link(__('New Dependent Territory', true), array('controller' => 'territories', 'action' => 'add'));?> </li>
		</ul>
	</div>
</div>
<div class="related">
	<h3><?php __('Related Addresses');?></h3>
	<?php if (!empty($territory['ProvinceAddress'])):?>
	<table cellpadding = "0" cellspacing = "0">
	<tr>
		<th><?php __('Address Id'); ?></th>
		<th><?php __('Street'); ?></th>
		<th><?php __('Number'); ?></th>
		<th><?php __('Floor'); ?></th>
		<th><?php __('Flat'); ?></th>
		<th><?php __('Neighborhood Id'); ?></th>
		<th><?php __('City Id'); ?></th>
		<th><?php __('Province Id'); ?></th>
		<th><?php __('Postal Code'); ?></th>
		<th><?php __('Created By'); ?></th>
		<th><?php __('Created'); ?></th>
		<th><?php __('Updated By'); ?></th>
		<th><?php __('Updated'); ?></th>
		<th class="actions"><?php __('Actions');?></th>
	</tr>
	<?php
		$i = 0;
		foreach ($territory['ProvinceAddress'] as $provinceAddress):
			$class = null;
			if ($i++ % 2 == 0) {
				$class = ' class="altrow"';
			}
		?>
		<tr<?php echo $class;?>>
			<td><?php echo $provinceAddress['address_id'];?></td>
			<td><?php echo $provinceAddress['street'];?></td>
			<td><?php echo $provinceAddress['number'];?></td>
			<td><?php echo $provinceAddress['floor'];?></td>
			<td><?php echo $provinceAddress['flat'];?></td>
			<td><?php echo $provinceAddress['neighborhood_id'];?></td>
			<td><?php echo $provinceAddress['city_id'];?></td>
			<td><?php echo $provinceAddress['province_id'];?></td>
			<td><?php echo $provinceAddress['postal_code'];?></td>
			<td><?php echo $provinceAddress['created_by'];?></td>
			<td><?php echo $provinceAddress['created'];?></td>
			<td><?php echo $provinceAddress['updated_by'];?></td>
			<td><?php echo $provinceAddress['updated'];?></td>
			<td class="actions">
				<?php echo $this->Html->link(__('View', true), array('controller' => 'addresses', 'action' => 'view', $provinceAddress['address_id'])); ?>
				<?php echo $this->Html->link(__('Edit', true), array('controller' => 'addresses', 'action' => 'edit', $provinceAddress['address_id'])); ?>
				<?php echo $this->Html->link(__('Delete', true), array('controller' => 'addresses', 'action' => 'delete', $provinceAddress['address_id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $provinceAddress['address_id'])); ?>
			</td>
		</tr>
	<?php endforeach; ?>
	</table>
<?php endif; ?>

	<div class="actions">
		<ul>
			<li><?php echo $this->Html->link(__('New Province Address', true), array('controller' => 'addresses', 'action' => 'add'));?> </li>
		</ul>
	</div>
</div>
<div class="related">
	<h3><?php __('Related Addresses');?></h3>
	<?php if (!empty($territory['CityAdderss'])):?>
	<table cellpadding = "0" cellspacing = "0">
	<tr>
		<th><?php __('Address Id'); ?></th>
		<th><?php __('Street'); ?></th>
		<th><?php __('Number'); ?></th>
		<th><?php __('Floor'); ?></th>
		<th><?php __('Flat'); ?></th>
		<th><?php __('Neighborhood Id'); ?></th>
		<th><?php __('City Id'); ?></th>
		<th><?php __('Province Id'); ?></th>
		<th><?php __('Postal Code'); ?></th>
		<th><?php __('Created By'); ?></th>
		<th><?php __('Created'); ?></th>
		<th><?php __('Updated By'); ?></th>
		<th><?php __('Updated'); ?></th>
		<th class="actions"><?php __('Actions');?></th>
	</tr>
	<?php
		$i = 0;
		foreach ($territory['CityAdderss'] as $cityAdderss):
			$class = null;
			if ($i++ % 2 == 0) {
				$class = ' class="altrow"';
			}
		?>
		<tr<?php echo $class;?>>
			<td><?php echo $cityAdderss['address_id'];?></td>
			<td><?php echo $cityAdderss['street'];?></td>
			<td><?php echo $cityAdderss['number'];?></td>
			<td><?php echo $cityAdderss['floor'];?></td>
			<td><?php echo $cityAdderss['flat'];?></td>
			<td><?php echo $cityAdderss['neighborhood_id'];?></td>
			<td><?php echo $cityAdderss['city_id'];?></td>
			<td><?php echo $cityAdderss['province_id'];?></td>
			<td><?php echo $cityAdderss['postal_code'];?></td>
			<td><?php echo $cityAdderss['created_by'];?></td>
			<td><?php echo $cityAdderss['created'];?></td>
			<td><?php echo $cityAdderss['updated_by'];?></td>
			<td><?php echo $cityAdderss['updated'];?></td>
			<td class="actions">
				<?php echo $this->Html->link(__('View', true), array('controller' => 'addresses', 'action' => 'view', $cityAdderss['address_id'])); ?>
				<?php echo $this->Html->link(__('Edit', true), array('controller' => 'addresses', 'action' => 'edit', $cityAdderss['address_id'])); ?>
				<?php echo $this->Html->link(__('Delete', true), array('controller' => 'addresses', 'action' => 'delete', $cityAdderss['address_id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $cityAdderss['address_id'])); ?>
			</td>
		</tr>
	<?php endforeach; ?>
	</table>
<?php endif; ?>

	<div class="actions">
		<ul>
			<li><?php echo $this->Html->link(__('New City Adderss', true), array('controller' => 'addresses', 'action' => 'add'));?> </li>
		</ul>
	</div>
</div>
<div class="related">
	<h3><?php __('Related Addresses');?></h3>
	<?php if (!empty($territory['NeighboorhoodAddress'])):?>
	<table cellpadding = "0" cellspacing = "0">
	<tr>
		<th><?php __('Address Id'); ?></th>
		<th><?php __('Street'); ?></th>
		<th><?php __('Number'); ?></th>
		<th><?php __('Floor'); ?></th>
		<th><?php __('Flat'); ?></th>
		<th><?php __('Neighborhood Id'); ?></th>
		<th><?php __('City Id'); ?></th>
		<th><?php __('Province Id'); ?></th>
		<th><?php __('Postal Code'); ?></th>
		<th><?php __('Created By'); ?></th>
		<th><?php __('Created'); ?></th>
		<th><?php __('Updated By'); ?></th>
		<th><?php __('Updated'); ?></th>
		<th class="actions"><?php __('Actions');?></th>
	</tr>
	<?php
		$i = 0;
		foreach ($territory['NeighboorhoodAddress'] as $neighboorhoodAddress):
			$class = null;
			if ($i++ % 2 == 0) {
				$class = ' class="altrow"';
			}
		?>
		<tr<?php echo $class;?>>
			<td><?php echo $neighboorhoodAddress['address_id'];?></td>
			<td><?php echo $neighboorhoodAddress['street'];?></td>
			<td><?php echo $neighboorhoodAddress['number'];?></td>
			<td><?php echo $neighboorhoodAddress['floor'];?></td>
			<td><?php echo $neighboorhoodAddress['flat'];?></td>
			<td><?php echo $neighboorhoodAddress['neighborhood_id'];?></td>
			<td><?php echo $neighboorhoodAddress['city_id'];?></td>
			<td><?php echo $neighboorhoodAddress['province_id'];?></td>
			<td><?php echo $neighboorhoodAddress['postal_code'];?></td>
			<td><?php echo $neighboorhoodAddress['created_by'];?></td>
			<td><?php echo $neighboorhoodAddress['created'];?></td>
			<td><?php echo $neighboorhoodAddress['updated_by'];?></td>
			<td><?php echo $neighboorhoodAddress['updated'];?></td>
			<td class="actions">
				<?php echo $this->Html->link(__('View', true), array('controller' => 'addresses', 'action' => 'view', $neighboorhoodAddress['address_id'])); ?>
				<?php echo $this->Html->link(__('Edit', true), array('controller' => 'addresses', 'action' => 'edit', $neighboorhoodAddress['address_id'])); ?>
				<?php echo $this->Html->link(__('Delete', true), array('controller' => 'addresses', 'action' => 'delete', $neighboorhoodAddress['address_id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $neighboorhoodAddress['address_id'])); ?>
			</td>
		</tr>
	<?php endforeach; ?>
	</table>
<?php endif; ?>

	<div class="actions">
		<ul>
			<li><?php echo $this->Html->link(__('New Neighboorhood Address', true), array('controller' => 'addresses', 'action' => 'add'));?> </li>
		</ul>
	</div>
</div>
